<template>
    <div>
      <h1>事件对象</h1>
      <button @click="handleClick">点击</button>
      <h1>数字：{{ count }}</h1>
      <button @click="add">加1+</button>
      <button @click="dd">减1-</button>
    </div>
  </template>
  
  <script setup>
  import { ref } from "vue";
  const count = ref(0);
  const add = (event) => {
    count.value++;
    if (count.value % 2 === 0) {
      event.target.style.backgroundColor = "red";
    } else {
      event.target.style.backgroundColor = "blue";
    }
  };
  const dd = () => {
    count.value--;
  };
  const handleClick = (event) => {
    console.log(event);
  };
  </script>
  
  <style>
  button {
    width: 100px;
    height: 50px;
    background-color: rgb(0, 221, 255);
  }
  </style>
  